package com.diandian.backend.entrance.client;

import com.diandian.backend.entrance.client.dto.MeituanOrderKeyPointUploadDTO;
import com.diandian.backend.entrance.dto.GetProductSkuInfoReqDTO;
import com.diandian.backend.entrance.dto.MeiTuanShanGouStockSyncDTO;
import com.diandian.base.boot.starter.response.BaseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

@FeignClient("meituan-shangou-exchange")
//@FeignClient(value = "business-diandian-meituan-shangou-exchange", url = "http://localhost:10003", path = "")
public interface DianDianMeiTuanShanGouClient {

    /**
     * 同步单条库存
     */
    @PostMapping("/business/product/sku/skuStockUpdateOne")
    BaseResult skuStockUpdateOne(@RequestHeader(value = "appKey") String appKey,
                                 @RequestHeader(value = "appSecret") String appSecret,
                                 @RequestHeader(value = "belong") String belong,
                                 @RequestBody MeiTuanShanGouStockSyncDTO data) throws Exception;

//    /**
//     * 更新商品编码
//     * @param appKey
//     * @param appSecret
//     * @param req
//     * @return
//     * @throws Exception
//     */
//    @PostMapping(value = "/business/product/updateAppFoodCodeByOrigin/open")
//    BaseResult updateAppFoodCodeByOrigin(@RequestHeader(value = "appKey") String appKey,
//                                         @RequestHeader(value = "appSecret") String appSecret,
//                                         @RequestBody ProductUpdateAppFoodCodeByOriginDTO req) throws Exception;

    /**
     * 上报订单关键节点信息
     */
    @PostMapping(value = "/basic/order/keyPointUpload")
    BaseResult keyPointUpload(@RequestHeader(value = "appKey") String appKey,
                              @RequestHeader(value = "appSecret") String appSecret,
                              @RequestBody MeituanOrderKeyPointUploadDTO dataDTO);

    /**
     * 查询商品sku库存信息
     */
    @PostMapping("/business/product/sku/getProductSkuStockInfo")
    BaseResult getProductSkuStockInfo(@RequestHeader(value = "appKey") String appKey,
                                             @RequestHeader(value = "appSecret") String appSecret,
                                             @RequestHeader(value = "belong") String belong,
                                             @RequestBody GetProductSkuInfoReqDTO data);
}
